#include <stdio.h>
#include <stdlib.h>
#include "cCUIWindow.h"
#include "cCUIWidget.h"
#include "cCUIApp.h"
#include "cCUIImage.h"

#pragma comment(lib, "glew32.lib")
#pragma comment(lib, "glfw3.lib")
#pragma comment(lib, "opengl32.lib")
#pragma comment(lib, "DevIL.lib")
#pragma comment(lib, "ILU.lib")
#pragma comment(lib, "ILUT.lib")


cCUIApp *myApp;
cCUIWindow *mainWindow;

//This will be called once when the window is ready.
//Use this function for creating widgets etc.
void OnLoad(sCUIEvent e)
{
	printf("OnLoad callback called!\n");
	cCUIWidget *testwidget;
	cCUIImage *mainBG;
	testwidget = new cCUIWidget();

	//Test values for widget.
	testwidget->widgetDetails.posX = 100;
	testwidget->widgetDetails.posY = 50;
	testwidget->widgetDetails.width = 50;
	testwidget->widgetDetails.height = 50;

	mainWindow->addWidget(testwidget);
	mainWindow->backgroundColor = CUIRGB(0.4f, 0.4f, 0.4f);
	mainBG = new cCUIImage("c:\\test\\testimage.png");
	mainWindow->setBackground(mainBG);
}

int main(void)
{
	//Initialise class pointers.
	mainWindow = new cCUIWindow(CUI_NoParent, "Test Window", 600, 600);
	myApp = new cCUIApp(mainWindow);

	//Window callbacks (so we can actually do more than just create a window)
	mainWindow->addCallBack(&OnLoad, CUI_OnLoad);

	//And run the app.
	myApp->run();

	return 0;
}